#ifndef CROW_EXT_H
#define CROW_EXT_H

#include "crow_all.h"

// Template function to start crow application
namespace crow_ext {
    template<typename T>
    void start_server(T& app, int port) {
        try {
            // Actually run the server in both Debug and Release modes
            std::cout << "Starting server on port: " << port << std::endl;
            app.port(port).run();
        }
        catch (const std::exception& e) {
            std::cerr << "Server error: " << e.what() << std::endl;
        }
        catch (...) {
            std::cerr << "Unknown server error" << std::endl;
        }
    }
}

#endif // CROW_EXT_H 